package com.ehotting.edsta.circuitDesign.gen.element.enums;

import com.ehotting.edsta.circuitDesign.enums.BaseEnum;

public enum ScriptTypeEnum implements BaseEnum {

    ASSIGNMENT(0,"赋值"),
    RANGE(1,"范围"),
    CONDITION(2,"条件"),
    FORMULA(3,"公式"),
    CUSTOM(4,"自主脚本"),
    UN_KNOW(100,"未知");

    ScriptTypeEnum(Integer value, String name) {
        this.value = value;
        this.name = name;
    }

    private Integer value;

    private String name;

    public Integer getValue() {
        return value;
    }

    public void setValue(Integer value) {
        this.value = value;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }



    public static ScriptTypeEnum get(Integer value){
        ScriptTypeEnum[] rules = ScriptTypeEnum.values();
        for(ScriptTypeEnum rule : rules){
            if(rule.getValue().equals(value)){
                return rule;
            }
        }
        return ScriptTypeEnum.UN_KNOW;
    }
}
